import React, {Component} from 'react'
import {HashRouter as Router,Route,Switch,Redirect} from "react-router-dom"
import Index from "./components/index/Index"
import Cart from "./components/cart/Cart"
import Category from "./components/category/Category"
import My from "./components/my/My"
import Tabbar from "./components/tabbar/Tabbar"
import SearchCenter from "./components/searchcenter/SearchCenter"
import GoodDetail from "./components/goodDetail/GoodDetail"
import GoodList from "./components/goodList/GoodList"
import Payment from "./components/payment/Payment"
export default class RouterConfig extends Component {
    render() {
        return (
           <Router>
               <Route path="/" exact render={()=><Tabbar><Index></Index></Tabbar>}></Route>
               <Route path="/Cart" exact render={()=><Tabbar><Cart></Cart></Tabbar>}></Route>
               <Route path="/Category" exact render={(props)=><Tabbar><Category {...props}></Category></Tabbar>}></Route>
               <Route path="/My" exact render={()=><Tabbar><My></My></Tabbar>}></Route>
               <Route path="/searchCenter" exact render={ ()=><SearchCenter></SearchCenter> }></Route>
               <Route path="/goodDetail/:goods_id" exact render={ (props)=><GoodDetail {...props}></GoodDetail> }></Route>
               <Route path="/goodList/:query" exact render={ (props)=><GoodList {...props}></GoodList> }></Route>
               <Route path="/Payment" exact render={ (props)=><Payment {...props}></Payment> }></Route>
           </Router>
        )
    }
}
